//
//  ZHAppDelegate.m
//  LBProjectCategoryViewController
//
//  Created by luckyBoyRoy@163.com on 11/14/2017.
//  Copyright (c) 2017 luckyBoyRoy@163.com. All rights reserved.
//

#import "ZHAppDelegate.h"
#import <LBCategoryApplication.h>
#import <LBApplicationLifeCycle.h>
#import "ZHViewController.h"

@implementation ZHAppDelegate
- (UIWindow *)window{
    if (!_window) {
        _window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
        _window.backgroundColor = [UIColor whiteColor];
    }
    return _window;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [LBCategoryApplication application:application didFinishLaunchingWithOptions:launchOptions];
    
    
    ZHViewController *zvc = [[ZHViewController alloc]init];
    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:zvc];
    self.window.rootViewController = nav;
    [self.window makeKeyAndVisible];
    
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
#pragma mark- iOS9之后才能用的
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options{
    
    BOOL result = NO;

    result = result ? :[LBCategoryApplication application:app openURL:url options:options];

    return result;
}
#pragma mark- iOS9之前用
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation{
    
    BOOL result = NO;

    result = result ? :[LBCategoryApplication application:application openURL:url options:nil];
    
    return result;
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler{
    return YES;
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
